package login;

import http.HelloServlet;
import http.HttpServletRequest;
import http.HttpServletResponse;

import javax.servlet.annotation.WebServlet;
import java.io.IOException;
@WebServlet("/login")
public class LoginServlet extends HelloServlet {
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {

        String user = request.getParameter("user");
        String pwd = request.getParameter("pwd");
        if("yc".equals(user) && "123".equals(pwd)){
            request.getSssion().setAttribute("loginedUser", user);
            response.sendRedirect("/Home.html");
        }else{
            response.sendRedirect("/login1.html");
        }
    }
}
